<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="viewport"
    content="width=device-width, minimum-scale=1.0, maximum-scale=2.0" />
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>

<script>
	function initList() {
		$('#tt').tree({
			url : "<c:url value='/dom/findDom.do'/>",
			//checkbox : true,
			loadFilter : function(data) {
				if (data.d) {
					return data.d;
				} else {
					return data;
				}
			},
			onClick : function(node) {
				
				if (node.link == 1) {
					downDom(node.id);
				}
			}
		});

	}

	$(document).ready(function() {
		initList();
	});

	function uploadDom() {
		var node = $('#tt').tree('getSelected');
		alert(node.text);
	}

	function downDom(id) {
		$('#excelForm').form('submit', {
			url : '<c:url value='/dom/downDom.do'/>' + "?id=" + id, //查询提交路径
			onSubmit : function()//提交按钮相应函数
			{
				return $('#excelForm').form('validate');
			},
			success : function(data) {
				data = eval("(" + data + ")");
				if (data.success) {
					$.messager.alert("提示", "提交成功！", 'info', function() {
						window.close();
					});
				} else {
					$.messager.alert("提示", data.msg, 'warning');
				}
			},
			error : function() {
				$.messager.alert("错误", "系统错误，请联系管理员！", 'error');
				return;
			}
		});
	}
</script>


</head>
<body>
	<table>
		
		<tr>
			<td>
				<form id="excelForm" name="excelForm" method="post"
					enctype="multipart/form-data" action="userlist.txt"
					onsubmit="return searchDGData(this.id,'listDisplay');"></form>
			</td>
		</tr>

		<tt>
			<td>
				<div
					style="height: auto; width: 400px; background: #fafafa; padding: 5px;"
					class="easyui-panel" title="文件路径" iconCls="icon-add"
					collapsible="true" minimizable="false" maximizable="false"
					closable="false">
					<table>
						<tr>
							<td>
								<ul id="tt" class="easyui-tree"></ul>
							</td>
						</tr>
					</table>
				</div>
			</td>
		</tt>
	</table>

</body>
</html>